<template>
	<section>
		<headers txt="我的二维码"></headers>
		<a href="javascript: void(0)" class="hued44 sz30 h_" @click="photos">
			重新生成
		</a>
		<figure class="qr_fig">
			<img v-if="qrCode" class="code-m" :src="qrCode" :onerror="$pub.errImg()">
			<img v-else class="code-m" @click="photos" src="../../assets/Other/qs_code.png">

			<figcaption class="flex_core mu30 sz30 hue666">
				<!--<img class="head-m" :src="photo" :onerror="$pub.errImg()" />-->
				<p>账户：<strong class="fontwt">{{phone}}</strong> </p>
			</figcaption>
		</figure>
	</section>
</template>

<script>
	import { Indicator } from 'mint-ui';
	export default {
		data() {
			return {
				qrCode: "",
//				photo: "",
				phone: "",
			}
		},
		created() {
			let v = this;
			let info = JSON.parse(sessionStorage.infos);
			v.qrCode = info.Members_QRCode;
//			v.photo = info.Members_HeadPhoto;
			v.phone = info.Members_Phone;

		},
		methods: {
			photos: function() {
				let v = this;
				Indicator.open();
				this.$http.get('/WorkMembersIntro/V1.0/CreateQRCode', {
					params: {
						"MembersID": sessionStorage.MembersID
					}
				}).then((res) => {
				Indicator.close();
					v.qrCode = res.data.Return_Data;
					let session = JSON.parse(sessionStorage.infos);
					session.Members_QRCode = res.data.Return_Data;
					sessionStorage.infos = JSON.stringify(session);

				})
			}
		},
	}
</script>

<style scoped>

</style>